# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: yk <yk at archlinuxcn dot org>

pkgname=shadowsocks-qt5
pkgver=3.0.1
pkgrel=2
pkgdesc="A fast, reliable and cross-platform GUI fronted for Shadowsocks."
arch=("loong64" "x86_64")
url="https://github.com/shadowsocks/shadowsocks-qt5"
license=("GPL")
depends=('qrencode' 'libqtshadowsocks' 'zbar')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/shadowsocks/shadowsocks-qt5/archive/v$pkgver.tar.gz")
sha512sums=('e4267af27098f08b6702083e26d15f32f4e345b2791f1461b44a91353f9211d4fee27f1f77de644c4338456ace7008802ca1de226d7261921c2044e811fd8405')

prepare() {
  cd shadowsocks-qt5-$pkgver

  # Disable appindicator (was needed for Qt < 5.4.2)
  sed -i '/APPINDICATOR/d' CMakeLists.txt
}

build() {
  cd shadowsocks-qt5-$pkgver
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
  make
}

package() {
  cd shadowsocks-qt5-$pkgver
  make DESTDIR="$pkgdir" install
}
